const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      defaultValue: null,
      comment: "主键",
      primaryKey: true,
      field: "id",
      autoIncrement: false
    },
    table_name: {
      type: DataTypes.CHAR,
      allowNull: false,
      defaultValue: null,
      comment: "表名",
      primaryKey: false,
      field: "table_name",
      autoIncrement: false,
      unique: "uk_tablename"
    },
    module_name: {
      type: DataTypes.CHAR,
      allowNull: true,
      defaultValue: null,
      comment: "模块名",
      primaryKey: false,
      field: "module_name",
      autoIncrement: false
    },
    package_name: {
      type: DataTypes.CHAR,
      allowNull: false,
      defaultValue: null,
      comment: "包名",
      primaryKey: false,
      field: "package_name",
      autoIncrement: false
    },
    business_name: {
      type: DataTypes.CHAR,
      allowNull: false,
      defaultValue: null,
      comment: "业务名",
      primaryKey: false,
      field: "business_name",
      autoIncrement: false
    },
    entity_name: {
      type: DataTypes.CHAR,
      allowNull: false,
      defaultValue: null,
      comment: "实体类名",
      primaryKey: false,
      field: "entity_name",
      autoIncrement: false
    },
    author: {
      type: DataTypes.CHAR,
      allowNull: false,
      defaultValue: null,
      comment: "作者",
      primaryKey: false,
      field: "author",
      autoIncrement: false
    },
    parent_menu_id: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: null,
      comment: "上级菜单ID，对应sys_menu的id ",
      primaryKey: false,
      field: "parent_menu_id",
      autoIncrement: false
    },
    create_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: null,
      comment: "创建时间",
      primaryKey: false,
      field: "create_time",
      autoIncrement: false
    },
    update_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: null,
      comment: "更新时间",
      primaryKey: false,
      field: "update_time",
      autoIncrement: false
    },
    is_deleted: {
      type: DataTypes.CHAR,
      allowNull: false,
      defaultValue: null,
      comment: "是否删除",
      primaryKey: false,
      field: "is_deleted",
      autoIncrement: false
    }
  };
  const options = {
    tableName: "gen_config",
    comment: "",
    indexes: []
  };
  const GenConfigModel = sequelize.define("gen_config_model", attributes, options);
  return GenConfigModel;
};